/**
 *
 */
package com.magist.manage.enums;


import com.magist.core.enums.BaseEnum;
import com.magist.core.enums.BaseEnum; import com.magist.core.util.TxtUtil;

/**
 * 结算方式
 */
public enum BalanceTypeEnum implements BaseEnum {

    BUY("BUY","买断"),PRE_PAY_DIVIDE("PrePayDivide","预付加分成"),DIVIDE("DIVIDE","无预付纯分成");
//    ,MIX_CLEAR("MixClear","复合结算");

    private String code;

    private String desc;

    private BalanceTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static BalanceTypeEnum getByCode(String code) {
        if (TxtUtil.isEmpty(code))
            return null;
        BalanceTypeEnum[] allEnums = BalanceTypeEnum.values();
        for (BalanceTypeEnum thisEnum : allEnums) {
            if (thisEnum.code.equals(code)) {
                return thisEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
